package thread.handsOn1;

import java.io.IOException;

public class TryThread2 extends Thread{
	int id;
	
	public TryThread2(int threadNum){
		this.id = threadNum;
	}
	
	public static void main(String[] args){
		TryThread2 t1 = new TryThread2(1);
		TryThread2 t2 = new TryThread2(2);
		TryThread2 t3 = new TryThread2(3);
		t1.start();t2.start();t3.start();
		try {
			System.in.read();
			System.out.println("Enter pressed..\n");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.println("Ending main()");
		return;		
	}
	
	public void run(){
		int i = 0;
		while(true){
			System.out.println("Thread "+id+" : " +i++);
		}
	}
}
